class TeamInfoModel{
  TeamReward reward;
  TeamPool pool;
  List<TeamUserList> dealer;
  List<TeamUserList> enroll;
  TeamInfoModel({this.reward,this.pool,this.dealer,this.enroll});
  TeamInfoModel.fromJson(Map<String, dynamic> json) {
    reward = json['reward'] != null ? TeamReward.fromJson(json['reward']) : null;
    pool = json['pool'] != null ? TeamPool.fromJson(json['pool']) : null;
    if (json['dealer'] != null) {
      dealer = [];
      json['dealer'].forEach((v) {
        dealer.add(TeamUserList.fromJson(v));
      });
    }else{
      dealer = [];
    }
    if (json['enroll'] != null) {
      enroll = [];
      json['enroll'].forEach((v) {
        enroll.add(TeamUserList.fromJson(v));
      });
    }else{
      enroll = [];
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.reward != null) {
      data['reward'] = this.reward.toJson();
    }
    if (this.pool != null) {
      data['pool'] = this.pool.toJson();
    }
    if (this.dealer != null) {
      data['dealer'] = this.dealer.map((v) => v.toJson()).toList();
    }else{
      data['dealer'] = this.dealer;
    }
    if (this.enroll != null) {
      data['enroll'] = this.enroll.map((v) => v.toJson()).toList();
    }else{
      data['enroll'] = this.enroll;
    }
    return data;
  }
}

class TeamReward{
  String id;
  String capping;
  String ach;
  String one_ach;
  String sach;
  dynamic share_rewards;
  String push_reward;
  String peer_reward;
  dynamic agent_reward;
  dynamic static_reward;
  dynamic direct_reward;
  TeamReward({this.id,this.capping,this.ach,this.one_ach,this.sach,this.share_rewards,this.push_reward,this.peer_reward,this.agent_reward,this.static_reward,this.direct_reward});
  TeamReward.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    capping = json['capping'];
    ach = json['ach'];
    one_ach = json['one_ach'];
    sach = json['sach'];
    share_rewards = json['share_rewards'];
    push_reward = json['push_reward'];
    peer_reward = json['peer_reward'];
    agent_reward = json['agent_reward'];
    static_reward = json['static_reward'];
    direct_reward = json['direct_reward'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['capping'] = this.capping;
    data['ach'] = this.ach;
    data['one_ach'] = this.one_ach;
    data['sach'] = this.sach;
    data['share_rewards'] = this.share_rewards;
    data['push_reward'] = this.push_reward;
    data['peer_reward'] = this.peer_reward;
    data['agent_reward'] = this.agent_reward;
    data['static_reward'] = this.static_reward;
    data['direct_reward'] = this.direct_reward;
    return data;
  }
}

class TeamPool{
  String bonus;
  String devote;
  String user;
  String sell;
  String time;
  TeamPool({this.bonus,this.devote,this.user,this.sell,this.time});
  TeamPool.fromJson(Map<String, dynamic> json) {
    bonus = json['bonus'];
    devote = json['devote'];
    user = json['user'];
    sell = json['sell'];
    time = json['time'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['bonus'] = this.bonus;
    data['devote'] = this.devote;
    data['user'] = this.user;
    data['sell'] = this.sell;
    data['time'] = this.time;
    return data;
  }
}

class TeamUserList{
  String id;
  String username;
  String truename;
  String capping;
  String ach;
  String sach;
  String level;
  String usdt;
  String myr;
  String head;
  String svip;
  TeamUserList({this.id,this.username,this.truename,this.capping,this.ach,this.sach,this.level,this.usdt,this.myr,
  this.head,this.svip});
  TeamUserList.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    username = json['username'];
    truename = json['truename'];
    capping = json['capping'];
    ach = json['ach'];
    sach = json['sach'];
    level = json['level'];
    usdt = json['usdt'];
    myr = json['myr'];
    head = json['head'];
    svip = json['svip'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['username'] = this.username;
    data['truename'] = this.truename;
    data['capping'] = this.capping;
    data['ach'] = this.ach;
    data['sach'] = this.sach;
    data['level'] = this.level;
    data['usdt'] = this.usdt;
    data['myr'] = this.myr;
    data['head'] = this.head;
    data['svip'] = this.svip;
    return data;
  }
}